﻿<%@ Page Title=""  Language="VB" MasterPageFile="~/bo/BOMaster.master" AutoEventWireup="false" CodeFile="RequestTickets.aspx.vb" Inherits="bo_RequestTickets" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        var SubPage = {};
        SubPage.SearchBy = "<%= SearchBy %>";
        //'Request_ID', 'Request_Subject', 'Request_Description', 'Request_CustomerID', 'Request_Status','Request_Date','Request_FirstName','Request_LastName','Request_EmailID', 'Request_Mobile', , 'Address', 'City', 'State', 'Country', 'Pin', 'CustomerActStatus'
        SubPage.Init = function () {
            jQuery("#list1").jqGrid({
                url: 'handlers/RequestTicketEvent.ashx?reftype=' + SubPage.SearchBy,
                datatype: "xml",
                colNames: ['ID', 'Reference','Assigned', 'Type', 'Subject', 'Date','FirstName', 'Mobile'],
                colModel: [
   		                { name: 'Request_ID', index: 'Request_ID', width: 20, align: "center" },
                         { name: 'Request_Reference', index: 'Request_Reference', width: 100 },
                          { name: 'Request_AssignedTo', index: 'Request_AssignedTo', width: 100 },
                          { name: 'Request_Type', index: 'Request_Type', width: 100 },
   		                { name: 'Request_Subject', index: 'Request_Subject', width: 120 },   		              
                       //{ name: 'Request_Description', index: 'Request_Description', width: 200 },
   		               // { name: 'Request_CustomerID', index: 'Request_CustomerID', width: 30 },
                      //  { name: 'Request_Status', index: 'Request_Status', width: 20 },
                        { name: 'Request_Date', index: 'Request_Date', width: 50 },
                        { name: 'Request_FirstName', index: 'Request_FirstName', width: 50 },
                       // { name: 'Request_LastName', index: 'Request_LastName', width: 50 },
                       // { name: 'Request_EmailID', index: 'Request_EmailID', width: 100 },
                        { name: 'Request_Mobile', index: 'Request_Mobile', width: 50 }
//                        { name: 'Request_Address', index: 'Request_Address', width: 70 },
//                        { name: 'Request_City', index: 'Request_City', width: 50 },
//                        { name: 'Request_State', index: 'Request_State', width: 50 },
//                        { name: 'Request_Country', index: 'Request_Country', width: 50 },
//                        { name: 'Request_Pin', index: 'Request_Pin', width: 50 },
//                        { name: 'Request_CustomerActStatus', index: 'Request_CustomerActStatus', width: 50 }
                       
                        ],

                rowNum: 10,
                autowidth: false,
                width:1000,
                rowList: [10, 20, 30, 40, 50, 100],
                pager: jQuery('#pager1'),
                sortname: 'id',
                viewrecords: true,
                sortorder: "desc",
                caption: "Request Tickets",

                ondblClickRow: function (id) { 
                    if(id){
                        var row = $("#list1").jqGrid('getRowData',id);
                       // alert(row.Request_ID)
                        SubPage.LoadCustDetails(row.Request_ID)
                    } 
                },
            }).navGrid('#pager1', { edit: false, add: false, del: false });
        }
    SubPage.LoadCustDetails = function (CustID) {
        $("#ContentPlaceHolder1_traceTxt").val(CustID);
        $("#ContentPlaceHolder1_hfldCustID").val(CustID);
        __doPostBack("ctl00$ContentPlaceHolder1$btnShowCustDetails","");
        
    }
</script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:HiddenField ID="traceTxt" runat="server" ></asp:HiddenField>
    <asp:HiddenField ID="hfldRequestID"  runat="server" />
 <asp:LinkButton ID="btnShowCustDetails" runat="server" CssClass="hide">LinkButton</asp:LinkButton>
 
 <div id="searchtabl" style="margin-top:20px; width:700px">
    <table id="list1"></table>
    <div id="pager1"></div>

 </div>
 <asp:Panel runat="server" ID="panelDetails" Visible="false">
 <div id="custDetails" class="custdetails">
    <table style="width:100%">
        <tbody>
            <tr>
                <td colspan="4" class="lblHeader">Request details</td>
            </tr>
             <tr>
                <td class="lblnames">Request Date</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblRequestDate"></asp:Label></td>
                 <td class="lblnames">Request Type</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblRequestType"></asp:Label></td>
             </tr>
             <tr>
                <td class="lblnames">Request Reference</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblReferenceId"></asp:Label></td>
                 <td class="lblnames">Assign To</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblAssignedTo"></asp:Label>
                    <asp:DropDownList ID="assignedTolist" runat="server" >
                       
                    </asp:DropDownList> 
                    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
                        ConnectionString="name=OneCDataEntities" 
                        DefaultContainerName="OneCDataEntities" EnableFlattening="False" 
                        EntitySetName="Users" Select="it.[User_UserName]">
                    </asp:EntityDataSource>
                    <asp:Button runat="server" ID="btnAssingedTo" Text="Assign" />
                    
                 </td>
             </tr>
            <tr>
                <td class="lblnames">Request ID</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lbRequestId"></asp:Label></td>
                <td class="lblnames">Status</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblStatus"></asp:Label><asp:Button runat="server" ID="btnStatus" Text="Close" /></td>
            </tr>
             <tr>
                <td class="lblnames">Subject</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblSubject"></asp:Label></td>
                <td class="lblnames">Description</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblDes"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">First name</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblFirstName"></asp:Label></td>
                <td class="lblnames">Last name</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblLastName"></asp:Label></td>
            </tr>
            <tr>
                <td class="lblnames">Email id</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblEmail"></asp:Label></td>
                <td class="lblnames">Mobile No</td>
                <td class="lblvalue"><asp:Label runat="server" ID="lblMobile"></asp:Label></td>
            </tr>
           
        </tbody>
    </table>
 </div>
   </asp:Panel>
    
</asp:Content>

